package com.blink.optimize.algorithm;

import com.blink.optimize.algorithm.lfu.LFUCache;

import java.util.Arrays;

/**
 * <Description> 测试最小使用次数算法</Description>
 * <ClassName> TestLFU</ClassName>
 *
 * @Author liuxianzhao
 * @Date 2018年01月09日 11:52
 */
public class TestLFU {
    public static void main(String[] args) {
        LFUCache lfuCache = LFUCache.create(5);
        for (int i = 0; i < 5; i++) {
            lfuCache.put("object" + i, i);
        }
        lfuCache.get("object0");
        lfuCache.get("object0");
        lfuCache.get("object4");
        lfuCache.get("object6");
        lfuCache.put("object5", 5);
        System.out.println(Arrays.asList(lfuCache.getCacheData()).toString());
    }

}
